// stores/dialogStore.js
import { defineStore } from 'pinia';

export const useKnowLedgeDialogStore = defineStore('knowLedgeDialog', {
  state: () => ({
    isOpen: false,
    nodeType:'',
    position:{
        clientX:0,
        clientY:0
    },
    addNodeFlag:false,
    fileName:'',
  }),
  actions: {
    open() {
      this.isOpen = true;
    },
    close() {
      this.isOpen = false;
      this.addNodeFlag = false;
    },
    addNode(){
      this.addNodeFlag = true;
      this.isOpen = false;
    },
    // addFile(data:any){
    //   this.fileName = data.fileName;
    // }
    // setAddNodeFlag(flag:boolean){
    //     this.addNodeFlag = flag;
    // }
  },
});